/*
 * @Author: silence
 * @Date: 2022-04-26 15:06:52
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-10-07 16:33:49
 * @Description: 定义App主要的颜色
 */

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class ColorUtils {
  /**
   * 通用基础颜色
   */
  // /**APP主体颜色  */
  static Color color_theme = Color.fromRGBO(2, 190, 199, 1);
  static Color color_theme_03 = Color.fromRGBO(2, 190, 199, 0.3);
  static Color color_theme_06 = Color.fromRGBO(2, 190, 199, 0.6);
  // static Color color_theme = Color.fromRGBO(19,109,197, 1);
  // static Color color_theme_03 = Color.fromRGBO(19,109,197, 0.3);
  // static Color color_theme_06 = Color.fromRGBO(19,109,197, 0.6);

  /**APP辅助色-警告色  */
  static Color color_theme_remind = Color.fromRGBO(255, 99, 0, 1);
  /**tabbar背景色 */
  static Color color_tabbar_bg = hexColor('#1d1d1d');

  /**背景颜色  */
  static Color color_bg = Colors.black; //Color.fromRGBO(23, 23, 23, 1);
  /**导航条颜色  */
  static Color nav_bar_bg = Colors.black; //Color.fromRGBO(23, 23, 23, 1);
  /**导航条文字的颜色  */
  static Color nav_bar_title = Colors.white; //Color.fromRGBO(48, 49, 51, 1);
  /**分割线颜色 */
  static Color color_divider_line = hexColor('#4d4d4d');
  // Colors.black; //Color.fromRGBO(30, 30, 30, 1);
  /**图片占位颜色  */
  static Color color_pic_default = Color.fromRGBO(217, 217, 217, 1);

  /**标题颜色  */
  static Color color_title = Color.fromRGBO(255, 255, 255, 1);
  /**副标题颜色  */
  static Color color_subtitle = Color.fromRGBO(255, 255, 255, 0.45);

  /**主要字体颜色  */
  static Color color_font_main = Color.fromRGBO(255, 255, 255, 1);
  /**次要字体颜色  */
  static Color color_font_minor = Color.fromRGBO(255, 255, 255, 0.45);
  /**占位字体颜色  */
  static Color color_font_placeholder = Color.fromRGBO(255, 255, 255, 0.25);

  /**
   * 小组件颜色
   */
  /**灰色按钮  */
  static Color color_btn_grey = Color.fromRGBO(186, 186, 186, 1);
  /**输入框背景色  */
  static Color color_input_bg =
      hexColor('#242424'); //;Color.fromRGBO(29, 29, 29, 1);
  /**tab按钮选中的颜色  */
  static Color color_tab_btn_selected = Color.fromRGBO(52, 52, 52, 1);
  /**tab按钮默认的颜色  */
  static Color color_tab_btn_noraml = Color.fromRGBO(29, 29, 29, 1);
  /**指示条颜色  */
  static Color color_indicator_bar = Color.fromRGBO(186, 186, 186, 1);
  /**底部Sheet颜色  */
  static Color color_bottom_sheet = Color.fromRGBO(52, 52, 52, 1);
  /**底部Sheet分割线颜色  */
  static Color color_bottom_sheet_line = Color.fromRGBO(139, 139, 139, 0.2);
  /**chart颜色  */
  static Color color_chart_line = Color.fromRGBO(145, 203, 116, 1);
  /**chart颜色  */
  static Color color_chart_line_06 = Color.fromRGBO(145, 203, 116, 0.6);

  /**
   * 其他颜色
   */
  /**价格的颜色  */
  static Color color_price = hexColor("28A745");
  static Color color_19_20_21 = Color.fromRGBO(19, 20, 21, 1);
  static Color color_128_128_128 = Color.fromRGBO(128, 128, 128, 1);
  static Color color_150_151_153 = Color.fromRGBO(150, 151, 153, 1);
  static Color color_48_49_51 = Color.fromRGBO(48, 49, 51, 1);
  static Color color_80_80_80 = Color.fromRGBO(80, 80, 80, 1);
  static Color color_241_102_0 = Color.fromRGBO(241, 102, 0, 1);
  static Color color_253_64_41 = Color.fromRGBO(253, 64, 41, 1);
  static Color color_26_26_26 = Color.fromRGBO(26, 26, 26, 1);
  static Color color_51_51_51 = Color.fromRGBO(51, 51, 51, 1);
  static Color color_0_153_255 = Color.fromRGBO(0, 153, 255, 1);
  static Color color_0_153_255_03 = Color.fromRGBO(0, 153, 255, 0.3);
  static Color color_204_204_204 = Color.fromRGBO(204, 204, 204, 1);
  static Color color_235_247_255 = Color.fromRGBO(235, 247, 255, 1);
  static Color color_248_248_250 = Color.fromRGBO(248, 248, 250, 1);

  /**
   * @description: HexColor
   * @param {*}
   * @return {*}
   */
  static Color hexColor(String hexString) {
    if (int.tryParse(hexString.substring(1, 7), radix: 16) == null) {
      hexString = '#999999';
    }
    return new Color(
        int.parse(hexString.substring(1, 7), radix: 16) + 0xFF000000);
  }

  /**
   * @description: 状态栏字体白色
   * @return {*}
   */
  static SystemUiOverlayStyle stateBarLight = SystemUiOverlayStyle(
    systemNavigationBarColor: Color(0xFF000000),
    systemNavigationBarDividerColor: null,
    statusBarColor: null,
    systemNavigationBarIconBrightness: Brightness.light,
    statusBarIconBrightness: Brightness.light,
    statusBarBrightness: Brightness.dark,
  );

  /**
   * @description: 状态栏字体黑色
   * @return {*}
   */
  static SystemUiOverlayStyle stateBarDark = SystemUiOverlayStyle(
    systemNavigationBarColor: Color(0xFF000000),
    systemNavigationBarDividerColor: null,
    statusBarColor: null,
    systemNavigationBarIconBrightness: Brightness.light,
    statusBarIconBrightness: Brightness.dark,
    statusBarBrightness: Brightness.light,
  );
}
